]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ctrlAltTab: Only set the stage focus mode when we're focusing a widget
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 2 Oct 2012 22:21:28 +0000 (19:21 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 3 Oct 2012 16:04:46 +0000 (13:04 -0300)
This ensures that we don't accidentally lose focus when switching to
the message tray.

https://bugzilla.gnome.org/show_bug.cgi?id=684633

js/ui/ctrlAltTab.js

index bd9bb1452816adbb2e405b45cb2cb89dfb675eee..0519c9900df4b6d8a44977a465eb8919bde7ae67 100644 (file)
@@ -54,16 +54,17 @@ const CtrlAltTabManager = new Lang.Class({
     },
 
     focusGroup: function(item) {
-        if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
-            global.stage_input_mode == Shell.StageInputMode.NORMAL)
-            global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
-
-        if (item.window)
+        if (item.window) {
             Main.activateWindow(item.window);
-        else if (item.focusCallback)
+        } else if (item.focusCallback) {
             item.focusCallback();
-        else
+        } else {
+            if (global.stage_input_mode == Shell.StageInputMode.NONREACTIVE ||
+                global.stage_input_mode == Shell.StageInputMode.NORMAL)
+                global.set_stage_input_mode(Shell.StageInputMode.FOCUSED);
+
             item.root.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+        }
     },
 
     // Sort the items into a consistent order; panel first, tray last,